/** @format */

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import vueJsx from "@vitejs/plugin-vue-jsx";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { VantResolver } from "@vant/auto-import-resolver";
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    proxy: {
      "/api": {
        target: "http://117.72.54.140:8083",
        // target: 'http://127.0.0.1:7001',

        changeOrigin: true,
      },
    },
    fs: {
      allow: [".."],
    },
  },

  plugins: [
    vue(),
    AutoImport({
      resolvers: [VantResolver()],
    }),
    Components({
      resolvers: [VantResolver()],
    }),
    vueJsx(),
  ],
  publicpath: "./",
  base: "./",
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },

  // 项目启动自动打开浏览器
  // open: true,
  // devServer: {
  //     open: true,
  // },
});
